Skip to content

IDE: Find and add workspace root if there are none #5285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 18, 2018

Conversation

Duhemm
Copy link
Contributor

@Duhemm Duhemm commented Oct 18, 2018

When the IDE is opened without a workspace (no folder is open), and then
a Scala source is opened, we will now search for the closest possible
workspace root (the closest parent directory that contains a
build.sbt). If no such directory can be found, the parent directory of
the file that has been opened is chosen. This folder is then added as a
workspace folder.

Adding a new workspace folder triggers a reloading of the extension. The
code of the extension will be executed in an environment where a
workspace root is set, and Dotty IDE will be able to start correctly.

Fixes #5281

When the IDE is opened without a workspace (no folder is open), and then
a Scala source is opened, we will now search for the closest possible
workspace root (the closest parent directory that contains a
`build.sbt`). If no such directory can be found, the parent directory of
the file that has been opened is chosen. This folder is then added as a
workspace folder.

Adding a new workspace folder triggers a reloading of the extension. The
code of the extension will be executed in an environment  where a
workspace root is set, and Dotty IDE will be able to start correctly.

Fixes scala#5281
Copy link
Member

@smarter smarter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but we should check this works on Windows

@Duhemm
Copy link
Contributor Author

Duhemm commented Oct 18, 2018

Good point, I verified and it works with the last commit 👍

@Duhemm Duhemm merged commit 294537f into scala:master Oct 18, 2018
@Duhemm Duhemm deleted the fix/5281-add-workspace branch October 18, 2018 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vscode-dotty: auto-configuration doesn't work when a file is opened outside a workspace
2 participants